           var eu = new window.easyUpload('#fileElem', {
            form: $('#uploadForm'),
            url: '/',
            type: 'POST', // form、base64、binary
            onAbort: function () {
                console.log('onAbort');
            },
            onError: function () {
                console.log('onError');
            },
            onLoadStart: function () {
                console.log('onLoadStart');
                $('#progress').val(0);
            },
            onLoadEnd: function () {
                console.log('onLoadEnd');
                $('#progress').val(0)
            },
            onProgress: function (that, percent) {
                console.log('onProgress');
                console.log(percent);
                if (percent < 100) {
                    $('#progress').val(percent);
                }
            },
            onLoad: function () {
                console.log('onLoad');
                // alert('上传成功');
            },
            onPreview: function (files) {
                console.log(files);
                var list = document.createElement("ul");
                for (var i = 0; i < files.length; i++) {
                    var li = document.createElement("li");
                    list.appendChild(li);

                    var img = document.createElement("img");
                    img.src = files[i].src;
                    img.classList.add("obj");
                    img.file = files[i];
                    img.width = 50;
                    img.height = 50;
                    dropbox.appendChild(img);
                    img.onload = function (e) {
                        //console.log(srcArr[i]);
                    };

                    li.appendChild(img);

                    var info = document.createElement("span");
                    info.innerHTML = files[i].name + ": " + files[i].size + " bytes";
                    li.appendChild(info);
                }
                document.getElementById('fileList').appendChild(list);
                // document.getElementById('fileList').style.display = "none";
            }
        });

        $('button').click(function (e) {
            e.preventDefault();
            eu.upload();
        });










/*
<script src = "/static/jquery.min.js"></script>
<script>
function upload() {
    var formData = new FormData();
    var file = document.getElementById('file').value;
    var id_token = $('#id_token').val();
    //var file = $('#file').val();
    formData.append("id_token", id_token);
    formData.append("file", file);
    $.ajax({
        url: "/up_file",
        type: "POST",
        data: formData,
        dataType: "json",
        cache: false,//上传文件无需缓存
        processData: false,//用于对data参数进行序列化处理 这里必须false
        contentType: false, //必须
        success: function (msg) {
            if(msg)
            {
                alert("上传成功");
            }
        }
    });
}
</script> 
*/